### GENDER AND WEALTH
### Doron Shiffer-Sebba and Julia Behrman
### Last updated: 10/19/2020, DSS


# Working with "gender" package (see vignette(topic = "predicting-gender", package = "gender"))
library(gender)

# Import data (adjust to user project folder path in line below):
namesData <- read.csv("/localpath/data/clean1.csv", colClasses = "character")

# Use social security data (method = "ssa") through genderdf() to estimate gender:
owner1gender <- gender_df(namesData,name_col = "firstname", year_col = c("minbirth","maxbirth"),
                          method = "ssa")

# Export data (adjust to user project folder path in line below):
write.csv(owner1gender,"/localpath/data/genderized.csv")


#> For journal article, please cite:
#> 
#> Cameron Blevins and Lincoln Mullen, "Jane, John ... Leslie? A
#> Historical Method for Algorithmic Gender Prediction," _Digital
#> Humanities Quarterly_ 9, no. 3 (2015):
#> <http://www.digitalhumanities.org/dhq/vol/9/3/000223/000223.html>.
